feat(deep_causality_tensor): Improved error handling#436
feat(deep_causality_tensor): Improved error handling#436marvin-hansen merged 7 commits intodeepcausality-rs:mainfrom
Conversation
Signed-off-by: Marvin Hansen <marvin.hansen@gmail.com>
Signed-off-by: Marvin Hansen <marvin.hansen@gmail.com>
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
||||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
||||||||||||
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #436 +/- ##
==========================================
+ Coverage 86.32% 92.91% +6.58%
==========================================
Files 777 777
Lines 31698 31708 +10
==========================================
+ Hits 27362 29460 +2098
+ Misses 4336 2248 -2088 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: Marvin Hansen <marvin.hansen@gmail.com>
Signed-off-by: Marvin Hansen <marvin.hansen@gmail.com>
Signed-off-by: Marvin Hansen <marvin.hansen@gmail.com>
Signed-off-by: Marvin Hansen <marvin.hansen@gmail.com>
Signed-off-by: Marvin Hansen <marvin.hansen@gmail.com>
User description
Describe your changes
Improved error handling
Issue ticket number and link
Code checklist before requesting a review
For details on make, please see BUILD.md
Note: The CI runs all of the above and fixing things before they hit CI speeds
up the review and merge process. Thank you.
PR Type
Enhancement
Description
Replace panic-prone
expect()calls with properResulterror handlingUse
ok_or_else()to convertOptiontoResultwith custom error typesReturn
CausalTensorError::EinSumErrorfor invalid tensor indicesImprove error propagation in einsum contraction operations
Diagram Walkthrough
File Walkthrough
ein_sum_impl.rs
Replace expect panics with Result error handlingdeep_causality_tensor/src/types/cpu_tensor/ops/tensor_ein_sum/ein_sum_impl.rs
expect()calls withok_or_else()for proper error handlingOptionvalues toResulttype withCausalTensorError::EinSumErrorEinSumValidationError::InvalidAxesSpecificationfor index out ofbounds errors
?operator instead of panicking